<?php

namespace app\common\order\validate;

use think\Validate;

class OrderValidate extends Validate
{
    protected $rule = [
        'category_id' => ['require'],
        'order_type' => ['require'],
        'company_id' => ['require'],
        'cooperation_id' => ['require'],
        'sign_date' => ['require'],
        // 'event_date' => ['require'],
        'store_id' => ['require'],
        'hall_id' => ['require'],
        'banquet_type_id' => ['require'],
        'bridegroom' => ['require'],
        'bridegroom_mobile' => ['require'],
        'totals' => ['require'],
        'collects' => ['require']
    ];

    protected $message = [
        'category_id.require' => '请选择信息类型',
        'order_type.require' => '请选择',
        'company_id.require' => '请选择签约公司',
        'cooperation_id.require' => '请选择合作模式',
        'event_date.require' => '请选择举办时间',
        'store_id.require' => '请选择承办酒店',
        'hall_id.require' => '请选择厅',
        'banquet_type_id.require' => '请选择宴会类型',
        'bridegroom.require' => '请录入联系人姓名',
        'bridegroom_mobile.require' => '请录入联系人手机号',
        'bridegroom_mobile.mobile' => '新郎手机号格式不正确',
        'totals.require' => '请录入订单总金额',
        'collects.require' => '请录入收款计划'
    ];

    protected $scene = [
        'rebate'  => ['category_id', 'company_id', 'sign_date', 'store_id', 'hall_id', 'banquet_type_id', 'bridegroom', 'bridegroom_mobile', 'totals'],
        'deposit'  => ['category_id', 'company_id', 'sign_date', 'bridegroom', 'bridegroom_mobile', 'totals'],
    ];
}